function showMsg(){ 
  // PUFF
  //  $("#nota-informativa").center();
  //  $( "#nota-informativa" ).show( 'puff', 1000 )
  //  .delay(2000)
  //  .hide( "puff", 1000 );
  alert('Cantidad debe ser mayor a 0')
  
  
}; 
function showSuccess(){ 
  var div = $("#nota-exito");
  div.show();
  $( "#nota-exito" ).dialog({
    modal: true,
    buttons: {
      ACEPTAR: function() {
        $( this ).dialog( "close" );
        div.hide();
        resetData();
      }
    }
  });
  
  
};


//Funcion para centrral DIV de mensaje
jQuery.fn.center = function () {
  this.css("position","absolute");
  this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + 
    $(window).scrollTop()) + "px");
  this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + 
    $(window).scrollLeft()) + "px");
  return this;
}

var $dialog = $('<div id="sharerdialog"></div>')
.html('<p>Venta Exitosa</p>')
.dialog({
  autoOpen: false,
  title: 'Confirmacion de Venta   ',
  position: ['center',150],
  width: 450,
  focus:function(event, ui) {
    $('#dialogcloser').click(function() {
      $dialog.dialog('close');
    });
  }, 
  buttons: {
    ACEPTAR: function() {
      $( this ).dialog( "close" );
      resetData();
    }
  }
});

var $dialogError = $('<div id="sharerdialog"></div>')
.html('<p>La cantidad minima de promocion debe ser 1</p>')
.dialog({
  autoOpen: false,
  title: 'Informe de Error  ',
  position: ['center',150],
  width: 450,
  focus:function(event, ui) {
    $('#dialogcloser').click(function() {
      $dialog.dialog('close');
    });
  }, 
  buttons: {
    CERRAR: function() {
      $( this ).dialog( "close" );
      resetData();
    }
  }
});

var $ErrorCantidad = $('<div id="sharerdialog"></div>')
.html('<p>Debe seleccionar al menos una promocion</p>')
.dialog({
  autoOpen: false,
  title: 'Informe de Error  ',
  position: ['center',150],
  width: 450,
  focus:function(event, ui) {
    $('#dialogcloser').click(function() {
      $dialog.dialog('close');
    });
  }, 
  buttons: {
    CERRAR: function() {
      $( this ).dialog( "close" );
      resetData();
    }
  }
});
// Bind the Share btn to Open the Modal
$('#itemshare').click(function() {
  $dialog.dialog('open');
});



var $dialogExtra= $('<div id="sharerdialog"></div>')
.html('<p>Gasto Extra Guardado</p>')
.dialog({
  autoOpen: false,
  title: 'Informe de Gatos ',
  position: ['center',150],
  width: 450,
  focus:function(event, ui) {
    $('#dialogcloser').click(function() {
      $dialog.dialog('close');
    });
  }, 
  buttons: {
    CERRAR: function() {
      $( this ).dialog( "close" );
         disablePopup();

    }
  }
});
var $errorExtra= $('<div id="sharerdialog"></div>')
.html('<p>Error, Gasto Extra No Guardado</p>')
.dialog({
  autoOpen: false,
  title: 'Informe de Gatos ',
  position: ['center',150],
  width: 450,
  focus:function(event, ui) {
    $('#dialogcloser').click(function() {
      $dialog.dialog('close');
    });
  }, 
  buttons: {
    CERRAR: function() {
      $( this ).dialog( "close" );

    }
  }
});

var $errorCaja= $('<div id="sharerdialog"></div>')
.html('<p>    Su Caja esta Cerrada, Solicite al Administrador que le asigne su Efectivo Inicial</p>')
.dialog({
 closeOnEscape: false,
  autoOpen: false,
  title: 'Informe de Caja',
  position: ['center',150],
  width: 550,
  modal: true,
  open: function(event, ui) { 
    //hide close button.
    $(this).parent().children().children('.ui-dialog-titlebar-close').hide();
},
  focus:function(event, ui) {
  }, 
  buttons: {
    CERRAR: function() {
      $( this ).dialog( "close" );
      window.location.href = "/"

    }
  }
});